package com.itheima.job.jobTest1;

public class Test {
    public static void main(String[] args) {
        palyGame(new Phone());
        palyGame(new Computer());
    }

    public static void palyGame(PlayGames playGames){
        if (playGames instanceof Phone){
            ((Phone)playGames).Play();
        }else if(playGames instanceof Computer){
            ((Computer)playGames).Play();
        }else {
            System.out.println("不能玩游戏");
        }
    }
}
